package com.egghiro.framework.j2se.game.map.maze;
import com.egghiro.framework.j2se.game.map.maze.creator.*;
import com.egghiro.framework.j2se.game.map.maze.exception.*;

public class RandomMazeMain {
    public static void main(String[] args) throws Exception {
        int[][] maze = createMaze(new PoleDownMazeCreator(), 29, 29);

        StringBuffer stringBuffer = new StringBuffer();
        for (int[] mazeRow : maze) {
            for (int cell : mazeRow) {
                stringBuffer.append(cell);
                stringBuffer.append(",");
            }
            stringBuffer.append("\n");
        }

        System.out.println(stringBuffer);
    }

    private static int[][] createMaze(MazeCreator mazeCreator, int xSize, int ySize) throws MazeSizeException {
        return mazeCreator.createMaze(xSize, ySize);
    }

}
